package com.itheima.thread;

public class Demo01 {

    public static void main(String[] args) {
        //创建线程对象
        MyThread t1 = new MyThread();
       // t1.setName("舒克");
        //开启线程
        t1.start();
        //创建线程对象
        MyThread t2 = new MyThread();
       // t2.setName("贝塔");
        //开启线程
        t2.start();
        for (int i = 0; i < 100; i++) {
            System.out.println("main中执行到了"+i);
        }


    }
}


class MyThread extends Thread{


    public MyThread() {
        super();
    }

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(this.getName()+"中执行到了"+i);
        }
    }
}